package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum CustomerReportEnum {
//    枚举类只能get,不能set.左边为name,右边为value
      Business("门店","b.name"),
      Year("年","DATE_FORMAT(c.pay_time, '%Y')"),
      Month("月","DATE_FORMAT(c.pay_time, '%Y%m')"),
      Day("日","DATE_FORMAT(c.pay_time, '%Y%m%d')");
      String name;
      String sql;

    CustomerReportEnum(String name, String sql) {
        this.name = name;
        this.sql = sql;
    }

    public static void main(String[] args) {
        System.out.println(CustomerReportEnum.Business.name);
        String name = CustomerReportEnum.Business.name();
        System.out.println(CustomerReportEnum.valueOf(name).getSql());


    }
}